package com.ybkj.daijia.common;


import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;

/**
 * 判断是否为主公司
 */
public class IsMainCompany {

    public static boolean isMain() {
        Subject subject = SecurityUtils.getSubject();
        if (null != subject && subject.getPrincipal() != null) {
            Principal principal = (Principal) subject.getPrincipal();
            if (principal.isCompanyType()) {
                return true;
            }
        }
        return false;
    }
}
